﻿<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="Microsoft.Help.SelfBranded" content="true" />
    <meta name="Language" content="en-us" />
    <meta name="Microsoft.Help.Locale" content="en-us" />
    <meta name="Microsoft.Help.TopicLocale" content="en-us" />
    <link rel="shortcut icon" href="../icons/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="../styles/branding.css" />
    <link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" />
    <script type="text/javascript" src="../scripts/branding.js"></script>
    <title>XmlHelp Class</title>
    <meta name="Title" content="XmlHelp Class" />
    <meta name="Microsoft.Help.Id" content="T:SosoMS.Common.FileHelp.XmlHelp" />
    <meta name="Microsoft.Help.ContentType" content="Reference" />
    <meta name="System.Keywords" content="SosoMS.Common.FileHelp.XmlHelp class" />
    <meta name="System.Keywords" content="XmlHelp class" />
    <meta name="Microsoft.Help.F1" content="SosoMS.Common.FileHelp.XmlHelp" />
    <meta name="Microsoft.Help.F1" content="XmlHelp" />
    <meta name="container" content="SosoMS.Common.FileHelp" />
    <meta name="file" content="931ae64d-1ef1-7c01-4eb4-cf2b5fc39cde" />
    <meta name="guid" content="931ae64d-1ef1-7c01-4eb4-cf2b5fc39cde" />
    <meta name="Microsoft.Help.Category" content="CSharp" />
    <meta name="Microsoft.Help.Category" content="XML" />
    <meta name="Description" content="XML文件帮助类" />
    <link type="text/css" rel="stylesheet" href="../styles/highlight.css" />
    <script type="text/javascript" src="../scripts/highlight.js"> </script>
    <link rel="stylesheet" type="text/css" href="../styles/branding-Help1.css" />
  </head>
  <body onload="SetDefaultLanguage('cs');">
    <input type="hidden" id="userDataCache" class="userDataStyle" />
    <div id="PageHeader" class="pageHeader">嗖嗖常用方法帮助集</div>
    <div class="pageBody">
      <div id="TopicContent" class="topicContent">
        <table class="titleTable">
          <tr>
            <td class="titleColumn">
              <h1>Xml<wbr />Help Class</h1>
            </td>
          </tr>
        </table>
        <div class="summary">
            XML文件帮助类   
            </div>
        <div class="collapsibleAreaRegion">
          <span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDDA')" onkeypress="SectionExpandCollapse_CheckKey('IDDA', event)" tabindex="0">
            <img id="IDDAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Inheritance Hierarchy</span>
        </div>
        <div id="IDDASection" class="collapsibleSection">
          <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">System<span id="LSTBD0AE1D0_0" data-languageSpecificText="cs=.|vb=.|cpp=::|nu=.|fs=."></span>Object</a>
          <br />  <span class="selflink">SosoMS.Common.FileHelp<span id="LSTBD0AE1D0_1" data-languageSpecificText="cs=.|vb=.|cpp=::|nu=.|fs=."></span>XmlHelp</span><br /></div>
        <br />
        <strong>Namespace:</strong> <a href="4f2fecb0-966c-232d-a819-c35018f8ad72.htm">SosoMS.Common.FileHelp</a><br /><strong>Assembly:</strong> SosoMS.Common (in SosoMS.Common.dll) Version: 1.0.0<div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDB')" onkeypress="SectionExpandCollapse_CheckKey('IDB', event)" tabindex="0"><img id="IDBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Syntax</span></div><div id="IDBSection" class="collapsibleSection"><div id="IDAB" class="codeSnippetContainer"><div class="codeSnippetContainerTabs"><div id="IDAB_tab1" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','cs','1','4');return false;">C#</a></div><div id="IDAB_tab2" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','vb','2','4');return false;">VB</a></div><div id="IDAB_tab3" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','cpp','3','4');return false;">C++</a></div><div id="IDAB_tab4" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','fs','4','4');return false;">F#</a></div></div><div class="codeSnippetContainerCodeContainer"><div class="codeSnippetToolBar"><div class="codeSnippetToolBarText"><a id="IDAB_copyCode" href="#" class="copyCodeSnippet" onclick="CopyToClipboard('IDAB');return false;" title="Copy">Copy</a></div></div><div id="IDAB_code_Div1" class="codeSnippetContainerCode" style="display: block"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">sealed</span> <span class="keyword">class</span> <span class="identifier">XmlHelp</span></pre></div><div id="IDAB_code_Div2" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">Public</span> <span class="keyword">NotInheritable</span> <span class="keyword">Class</span> <span class="identifier">XmlHelp</span></pre></div><div id="IDAB_code_Div3" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">ref class</span> <span class="identifier">XmlHelp</span> <span class="keyword">sealed</span></pre></div><div id="IDAB_code_Div4" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve">[&lt;<span class="identifier">SealedAttribute</span>&gt;]
<span class="keyword">type</span> <span class="identifier">XmlHelp</span> = <span class="keyword">class</span> <span class="keyword">end</span></pre></div></div></div></div><p>The <span class="selflink">XmlHelp</span> type exposes the following members.</p><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDAAEA')" onkeypress="SectionExpandCollapse_CheckKey('IDAAEA', event)" tabindex="0"><img id="IDAAEAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Constructors</span></div><div id="IDAAEASection" class="collapsibleSection"><table id="ConstructorList" class="members"><tr><th class="iconColumn"> </th><th>Name</th><th>Description</th></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="d448dbd5-c595-ca00-8d4f-deb79af66630.htm">XmlHelp(String)</a></td><td>
            以文件名构造，加载一个现有的xml文件<br />
            如果文件不存在，就会抛出一个异常
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="01e03980-3421-3b16-35b8-0d729fc59486.htm">XmlHelp(String, String)</a></td><td>
            以文件名和根节点名称构造，如果文件存在，会直接加载此文件<br />
            如果文件不存在，会建立以rootStr为根节点的xml文件
            </td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDBEA')" onkeypress="SectionExpandCollapse_CheckKey('IDBEA', event)" tabindex="0"><img id="IDBEAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Methods</span></div><div id="IDBEASection" class="collapsibleSection"><table id="MethodList" class="members"><tr><th class="iconColumn"> </th><th>Name</th><th>Description</th></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/CodeExample.png" alt="Code example" title="Code example" /></td><td><a href="ba0fc6ac-5f28-ea3d-6596-96aa0ecb47b3.htm">CreateXElement</a></td><td>
            创建一个<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement" target="_blank" rel="noopener noreferrer">XElement</a>对象
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)" target="_blank" rel="noopener noreferrer">Equals</a></td><td>Determines whether the specified object is equal to the current object.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode#system-object-gethashcode" target="_blank" rel="noopener noreferrer">GetHashCode</a></td><td>Serves as the default hash function.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/CodeExample.png" alt="Code example" title="Code example" /></td><td><a href="8af02d10-10f2-930f-d68e-4b08e661fa4b.htm">GetKeyValuesFromXElementAttributes</a></td><td>
            获取<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement" target="_blank" rel="noopener noreferrer">XElement</a>节点中所有特性的键和值
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype#system-object-gettype" target="_blank" rel="noopener noreferrer">GetType</a></td><td>Gets the <a href="https://learn.microsoft.com/dotnet/api/system.type" target="_blank" rel="noopener noreferrer">Type</a> of the current instance.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/CodeExample.png" alt="Code example" title="Code example" /></td><td><a href="b0e1a739-a629-1ae0-e383-838f3505b62a.htm">GetXElements</a></td><td>
            获取<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement" target="_blank" rel="noopener noreferrer">XElement</a>集合
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="deb88f38-b742-a0de-378a-48e53a33e48e.htm">Save</a></td><td>
            保存到文件
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.tostring#system-object-tostring" target="_blank" rel="noopener noreferrer">ToString</a></td><td>Returns a string that represents the current object.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/CodeExample.png" alt="Code example" title="Code example" /></td><td><a href="107e7fcc-143a-fed5-fe7f-7d515e3665d9.htm">UpdateXElementAttribute</a></td><td>
            使用特性字典更新<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement" target="_blank" rel="noopener noreferrer">XElement</a>对象中的特性值
            </td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDBC')" onkeypress="SectionExpandCollapse_CheckKey('IDBC', event)" tabindex="0"><img id="IDBCToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Remarks</span></div><div id="IDBCSection" class="collapsibleSection">
            使用<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xdocument" target="_blank" rel="noopener noreferrer">XDocument</a>对一个存在的XML文件进行读写，并加载到XML文件树中<br />
            读取出来的所有节点都为<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement" target="_blank" rel="noopener noreferrer">XElement</a>对象<br />
            使用<a href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xdocument" target="_blank" rel="noopener noreferrer">XDocument</a>生成一个XML文件，并保存到相应的路径
            </div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('seeAlso')" onkeypress="SectionExpandCollapse_CheckKey('seeAlso', event)" tabindex="0"><img id="seeAlsoToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />See Also</span></div><div id="seeAlsoSection" class="collapsibleSection"><h4>Reference</h4><div><a href="4f2fecb0-966c-232d-a819-c35018f8ad72.htm">SosoMS.Common.FileHelp Namespace</a></div><div><a href="https://learn.microsoft.com/dotnet/api/system.xml.linq" target="_blank" rel="noopener noreferrer">System.Xml.Linq</a></div></div></div>
    </div>
    <div id="PageFooter" class="pageFooter" />
  </body>
</html>